package demo05;

public class Role {
    int id;

    public Role(int id, String name, int blood) {
        this.id = id;
        this.name = name;
        this.blood = blood;
    }

    String name;
    int blood;
    Armour armour;
    Weapon weapon;
    public Armour getArmour() {
        return armour;
    }

    public void setArmour(Armour armour) {
        this.armour = armour;
    }

    public Weapon getWeapon() {
        return weapon;
    }

    public void setWeapon(Weapon weapon) {
        this.weapon = weapon;
    }

    public void attack(){
        System.out.println(name+"身上穿着"+getArmour().name+" 重"+armour.weight+",正在用"+getWeapon().name+"攻击敌方");
        System.out.println("造成了"+weapon.hurt+"点伤害");
    }
    public void showRole(){
        System.out.println("角色名是:"+name+" 角色的id是:"+id+" 角色当前血量是:"+blood);
    }

}
